#!/bin/sh
cur_dir=`pwd`


sudo yum -y install zlib zlib-devel
sudo yum -y install bzip2 bzip2-devel
sudo yum -y install ncurses ncurses-devel
sudo yum -y install readline readline-devel
sudo yum -y install openssl openssl-devel
sudo yum -y install openssl-static
sudo yum -y install xz lzma xz-devel
sudo yum -y install sqlite sqlite-devel
sudo yum -y install gdbm gdbm-devel
sudo yum -y install tk tk-devel
sudo yum install libffi-devel -y

my_url=http://10.45.17.5:8080/src_dir/tarball

tgt=Python-3.7.0
tgt_suffix=tgz
tgt_name=$tgt.$tgt_suffix

tmp_dir=/var/tmp

cd $tmp_dir
if [ ! -f $tgt.$tgt_suffix ]; then
    wget $my_url/$tgt_name
fi 

tar -zxf $tgt_name
cd $tgt
./configure --prefix=$HOME --enable-shared CFLAGS=-fPIC --enable-optimizations
echo "-- current dir is `pwd`"
make -j8 && make install



